/*1关系运算符*/
public class j2 {
    public static void main1(String[] args) {
        int a=1;
        int b=2;
        System.out.println(a<b);
    }
    /*2while循环九的阶乘*/
    public static void main3(String[] args) {
       int j=1;
        int num =0;
       while(j<=9){
        int i=1;
        int ret=1;
       while(i<=j){
           ret*=i;
           i++;
       }
         j++;
          num+=ret;
       }
        System.out.println(num);
    }
    /*3while if嵌套循环，continue,break的用法*/
    public static void main4(String[] args) {
        int i=1;
        while(i<=10){
            if(i==3){
                i++;
                continue;/*break;*/
            }
            System.out.println(i);
            i++;
        }


    }
    /*2while循环的阶乘*/
    public static void main2(String[] args) {
      int a=1;
      int ret=1;
      while(a<=5){
          ret*=a;
          a++;
      }
        System.out.println(ret);
    }
    /*4 利用continue 在while if嵌套循环求1~100能被3,5同时整除的数字*/
    public static void main5(String[] args) {
        int i=1;
        while(i<=100){
            if(i%15!=0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }

    }
    /*4利用continue 在for if嵌套循环求1~100能被3,5同时整除的数字*/
    public static void main6(String[] args) {
        for (int i=1;i<=100;i++){
            if(i%15!=0){
                i++;
                continue;
            }
            System.out.println(i);
        }
    }


    /*5利用for 循环嵌套求1-9的阶乘*/
    public static void main8(String[] args) {

int sum=0;
        for (int j = 1; j <=9; j++) {
            int ret=1;
        for (int i = 1; i <=j; i++) {
            ret*=i;
        }
            sum+=ret;
        }
        System.out.println( sum);
    }



    public static void main7(String[] args) {
        int i=1;
        int ret=1;
        int j=1;
        int sum=0;
        while(j<=9) {
            while (i <= j) {
                ret *= i;
                i++;
            }
            j++;
            sum+=ret;
            System.out.println(sum);
        }
    }
}

